package com.itheima.sentinel.config;

import com.alibaba.csp.sentinel.adapter.servlet.callback.WebCallbackManager;
import com.itheima.sentinel.service.impl.RequestOriginParserDefinition;

import javax.annotation.PostConstruct;

/**
 * @Class: SentinelConfig
 * @Package com.itheima.sentinel.config
 * @Description:将自定义的阈值提示加载到应用中
 * @Company: http://www.itheima.com/
 */
public class SentinelConfig {
    
    @PostConstruct
    public void init() {
        //黑白名单，将自定义的阈值提示加载到应用中
        WebCallbackManager.setRequestOriginParser(
                (com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser)
                        new RequestOriginParserDefinition());
    }
    
}
